package practice_1;

public class Print {

	public static void main(String[] args) {
		System.out.printf("Hello--%s\n","world");  //输出hello--world
		System.out.format("%c%c\n",'T','w');         //输出 TW
		System.out.printf("100的十六进制是%x\n",100);  //输出64
		System.out.printf("2>1的结果是%b\n",2>1);     //输出 2>1 结果为ture
		System.out.printf("123*0.65=%g\n",123*0.65);
		System.out.printf("%d%%%n",75);  //输出75%并且换行  %n——换行
		String str = String.format("%d+%d = %d", 1,2,1+2);
		System.out.println(str);
		System.out.printf(str);
		System.out.println("------------------------------");
		System.out.printf("%d,%d\n",+1234,-1234);
		System.out.format("%,d\n",12345678); //???
		System.out.printf("%8d\n",1234);
		System.out.printf("%08d\n",1234);
		System.out.printf("%.2f\n",1234.5678);  //保留两位小数
		System.out.printf("%8.2f\n",1234.5678); 
		System.out.printf("%-8s\n","LOVE");
		
		
		
	}

}
